package com.mengshuai.technology.order.controller;


import com.mengshuai.technology.order.bean.Users;
import com.mengshuai.technology.order.service.UsersService;
import org.springframework.beans.factory.annotation.Autowired;
import org.springframework.web.bind.annotation.GetMapping;
import org.springframework.web.bind.annotation.RequestMapping;

import org.springframework.web.bind.annotation.RestController;

import java.util.List;

/**
 * <p>
 *  前端控制器
 * </p>
 *
 * @author ms
 * @since 2025-06-19
 */
@RestController
@RequestMapping("/users")
public class UsersController {
    @Autowired
    private UsersService usersService;
    @GetMapping("/getUserById")
    public Users getUserById(Integer id){
        return usersService.getUserById(id);
    }

    @GetMapping("/deleteUserById")
    public void deleteUserById(Integer id){
        usersService.deleteUserById(id);
    }

    @GetMapping("/getAllUsers")
    public List<Users> getAllUsers(Users users){
        return usersService.getAllUsers(users);
    }
}
